"""
@author: wy
@file: 7.py
@time: 2023/12/7 19:05
"""
#7、定义一个字典，value都为整数类型。输出字典中value的最大值以及它的key，输出字典中value的平均值
def dictmax(dict1):
    max_value=0
    k=0
    sum_value=0
    for i,j in dict1.items():
        sum_value +=j
        if j>max_value:
            max_value=j
            k=i
    avg_value= sum_value/len(dict1)

    return f"max_value is {max_value},max_key is {k},avg_value is {avg_value}"

d1={'aa':100,
    'yy':150,
    'xx':250
    }

print(dictmax(d1))